<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>GameChampion | game</title>

    <meta
      name="keywords"
      content="GameChampion, action games, action games free, action games online, action games in online, action games shooting, action games best"
    />
    <meta
      name="description"
      content="Play the Best Free Online games. Fighting games, racing games, shooting games, sports games, boys games, girls games, kids games, all these html5 games can be played on your mobile, pad and tablet directly without installation. Have fun! - GameChampion"
    />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="http://kufeient.com" />
    <meta property="og:site_name" content="GameChampion" />
    <meta
      property="og:title"
      content="GameChampion — Free Online Games to Play"
    />
    <meta property="og:description" content="Play The Best Free Online Games" />

    <link rel="icon" href="static/image/favicon.png" />
    <link rel="stylesheet" href="./static/css/base.css" />
    <link rel="stylesheet" href="./static/css/detail.css" />

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jsrender@1.0.15/jsrender.min.js"></script>
  </head>

  <body class="bp-nouveau archive category category-word category-841 no-js">
    <section class="wrpp">
      <div id="header"></div>
      <section class="bdcn">
        <section class="cont flol">
          <header class="title bg bgco1 rnd5">
            <h1 class="gameTitle"></h1>
          </header>

          <article class="blkcnt bgco2 game-info post-advrsm">
            <header class="bltitl">
              <h2 class="gameTitle"></h2>
              Game info
            </header>
            <section class="blcnbx">
              <figure class="imgcnt">
                <img class="gameImg" src="static/image/placeholder-img.png" />
              </figure>
              <section>
                <p><strong>Description:</strong></p>
                <div class="gameDesc">
                  <p></p>
                </div>
                <a
                  href="#"
                  id="gameLink"
                  class="play-btn pulse animated infinite"
                >
                  PLAY NOW
                </a>
              </section>
            </section>
            <div
              id="gameIframe"
              style="position: relative; z-index: 9999999999999"
            >
              <iframe
                id="iframe1"
                frameborder="no"
                style="
                  display: none;
                  position: fixed;
                  top: 0;
                  left: 0;
                  height: 100%;
                  width: 100%;
                "
              ></iframe>
            </div>
          </article>
          <!--  -->
          <section class="blkcnt bgco2">
            <div class="bltitl">More games</div>
            <div class="blcnbx scrlbr mCustomScrollbar _mCS_1">
              <div
                class="mCustomScrollBox mCS-light mCSB_horizontal"
                id="mCSB_1"
              >
                <div class="mCSB_container" style="position: relative" id="gameNew">
                 
                </div>
              </div>
            </div>
          </section>

          <script>
            let params = new URLSearchParams(document.location.search);
            let id = params.get("id");

            $.ajax({
              url: `https://app.nocodb.com/api/v2/tables/mg01furv08tboqh/records/${id}`,
              type: "GET",
              dataType: "json",
              headers: {
                "xc-token": "dePwLQ88UMbt4O9ndpBSQ-6RUC_nIhhpPea_0kTR",
              },
              contentType: "application/json; charset=utf-8",
              success: function (gameData) {
                $(".gameTitle").text(gameData.name);
                $(".gameDesc p").text(gameData.desc);
                $(".gameImg").prop("src", gameData.cover);
                // $("#gameLink").prop("href", 'h5game/' + gameData.name.replace(/\s*/g, "") + '/index.html');
                if (!gameData.link) {
                  gameData.link =
                    window.location.origin +
                    "/h5game/" +
                    gameData.name.replace(/\s*/g, "") +
                    "/index.html";
                }
                $("#gameLink").prop(
                  "href",
                  `javascript:playGame("${gameData.link}");`
                );
              },
              error: function (error) {
                console.error(error);
              },
            });

            function playGame(link) {
              $("#iframe1").prop("src", link).show();
            }
          </script>
        </section>
        <aside class="sdbr flor">
          <section
            id="mabp_most_rated-2"
            class="blkcnt bgco2 widget_mabp_most_rated"
          >
            <div class="bltitl">Most Rated Games</div>
          <div id="gameHot"></div>
          </section>
        </aside>
      </section>
      <footer id="footer"></footer>
    </section>
  </body>

  <script type="text/javascript" src="static/js/common.js"></script>
</html>
